﻿using System;
using System.Threading;

namespace Xenta.Tasks
{
    /// <summary>
    /// Exposes the task interface.
    /// </summary>
    /// <remarks>
    /// The task component allows to define some routine, 
    /// which is being executed periodically. All tasks 
    /// are being scheduled by the task scheduler
    /// component.
    /// </remarks>
    public interface ITask : IDependency
    {
        #region Properties

        /// <summary>
        /// Gets the task priority.
        /// </summary>
        ThreadPriority Priority
        {
            get;
        }

        /// <summary>
        /// Gets the task period.
        /// </summary>
        TimeSpan Period
        {
            get;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Performs the task procedure.
        /// </summary>
        void TaskProc();

        #endregion
    }
}
